package objects.data;

import objects.ObjectCodes;

import com.google.gson.Gson;

public class ClusterData implements ObjectCodes {
	public String hostname;
	public String local_hostname;
	public int nodes;
	public int procs;
	public int rjobs;
	public int qjobs;
	public int db_id;
	public boolean isOn;
	
	public ClusterData(){}
	
	public ClusterData(String h, String lh)
	{
		this.hostname = h;
		this.local_hostname = lh;
	}
	
	public ClusterData(ClusterData cd)
	{
		this.hostname = cd.hostname;
		this.local_hostname = cd.local_hostname;
		this.nodes = cd.nodes;
		this.procs = cd.procs;
		this.rjobs = cd.rjobs;
		this.qjobs = cd.qjobs;
		this.db_id = cd.db_id;
		this.isOn = cd.isOn;
	}
	
	public String toString()
	{
		return new Gson().toJson(this);
	}
	
	public static ClusterData fromJSon(String json)
	{
		return new Gson().fromJson(json,ClusterData.class);
	}

}
